package com.backend.controller;

import com.backend.common.LookUpContion;
import com.backend.config.Result;
import com.backend.service.ActionService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.ArrayList;
import java.util.List;


@Api(tags = "社团活动管理模块",value = "基础业务操作")
@RestController
@RequestMapping("/user")
public class ActionController {

    @Autowired
    ActionService actionService;

    @PostMapping("/queryAllAction")
    @ApiOperation(value = "学生所参加的所有社团活动",httpMethod = "POST")
    public Result lookUpByAction(@RequestBody LookUpContion lookUpContion){

        return actionService.lookUpUserAllAction(lookUpContion);
    };

    @GetMapping("/get")
    public List get(@RequestParam("id") String id){
        List list=new ArrayList();
        list.add(id);
        return list ;
    };


    @GetMapping("/actionImageById")
    @ApiOperation(value = "活动当前所有照片",httpMethod = "GET")
    public  Result lookUpActionImageById(@RequestParam("actionId")String actionId ){

        return actionService.lookUpActionImageById(actionId);
    }

    @PostMapping("/getAllAction")
    public Result getAllAction(@RequestBody LookUpContion lookUpContion){

        return actionService.getAllAction(lookUpContion);
    };

}
